﻿using System;

/// <summary>
/// TSqlDBItem 的摘要说明
/// </summary>
public class TSqlDBItem
{
    private object FObject; //唯一的私有成员，存放转换前的原始数据

    public TSqlDBItem(object Obj)
    {
        FObject = Obj;
    }

    public override string ToString()
    {
        string Result = "";
        if (FObject != null)
            Result = FObject.ToString();

        return Result;
    }

    public int ToInt()
    {
        int Result = 0;
        if ((FObject != null) && (FObject.ToString() != ""))
            Result = System.Convert.ToInt16(FObject);
        return Result;
    }

    public DateTime ToDataTime()
    {
        DateTime Result = DateTime.Now;

        if ((FObject != null) && (FObject.ToString() != ""))
            Result = System.Convert.ToDateTime(FObject);
        return Result;
    }
}